
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>闵行区医疗卫生机构管理中心数据分析报告</title>
  <link href="images/favicon.ico" rel="shortcut icon" />
  <link rel="stylesheet" href="login/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="login/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="login/css/form-elements.css">
  <link rel="stylesheet" href="login/css/style.css">
  <link rel="stylesheet" href="plugins/flavr/flavr.css">
  <link rel="stylesheet" href="plugins/iziModal/css/iziModal.min.css">

  <!-- Favicon and touch icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="login/ico/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="login/ico/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="login/ico/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="login/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>

<!-- Top content -->
<div class="top-content">
  <div class="inner-bg">
    <div class="container">
      <div class="row">
        <div class="col-sm-8 col-sm-offset-2 text">
          <h1>
            闵行区医疗卫生机构管理中心<br>
            数据分析报告
          </h1>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-6 col-sm-offset-3 form-box">
          <div class="form-top">
            <div class="form-top-left">
              <h3>登录</h3>
              <p>输入账号登录</p><!-- 手机号密码登录 -->

            </div>
            <div class="form-top-right">
              <i class="fa fa-key"></i>
            </div>
          </div>
          <div class="form-bottom">
            <form id="form" role="form" action="login" method="post" class="login-form">
              <div class="form-group">
                <label class="sr-only" for="username">登录</label>
                <input type="text" name="username" placeholder="请输入帐号" class="form-username form-control" id="username" value="">
              </div>
              <div class="form-group">
                <label class="sr-only" for="password">密码</label>
                <input type="password" name="password" placeholder="密码" class="form-password form-control" id="password">
              </div>
              <p class="text-danger"></p>
              <p>
                <button type="button" onclick="login()" class="btn">登录</button>
            </form>
            <!--<a href="javascript:openCodeModel();" style="position: relative; left: 420px; top: 0px;" >忘记密码？</a>-->
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="request-image"  style="display:none;position: fixed;width: 100%;top: 0;left: 0;height: 100%;z-index: 9999;background: rgba(255, 255, 255, 0)">
  <img src="images/request-sending.gif" style="position: absolute;margin-top: -100px;top: 50%;left: 50%;margin-left: -100px;width: 200px;height: 200px;z-index: 9999999">
</div>

<!-- Javascript -->
<script src="login/js/jquery-1.11.1.min.js"></script>
<script src="login/bootstrap/js/bootstrap.min.js"></script>
<script src="login/js/jquery.backstretch.min.js"></script>
<script src="login/js/scripts.js"></script>
<script src="plugins/flavr/flavr.min.js"></script>
<script src="plugins/iziModal/js/iziModal.min.js"></script>
</body>
<script type="text/javascript">
    $(document).ready(function (){
        document.onkeydown = function (event) {
            var e = event || window.event;
            if (e && e.keyCode == 13) { //回车键的键值为13
                login();
            }
        };
    });

    function login(){
        $(".request-image").show();
        $.ajax({
            url:'login',
            type:'POST',
            dataType:"json",
            data:{"username":$("#username").val(),"password":$("#password").val()},	// 参数
            success:function(data){
                $(".request-image").hide();
                try {
                    // alert(jQuery.stringifyJSON(data));
                    if(data.ret === 1){
                        location.href="html/index.html";
                    }else {
                        $(".text-danger").html(data.msg);
                    }
                } catch (error) {
                    new $.flavr({content:"操作遇到问题",closeOverlay:true,closeEsc:true,autoclose:true,timeout:1500,buttons:[{text:'确定',style:'danger',action:function(){}}]});
                }
            },
            failure : function() {
                $(".request-image").hide();
                new $.flavr({content:"操作遇到问题",closeOverlay:true,closeEsc:true,autoclose:true,timeout:1500,buttons:[{text:'操作失败',style:'danger',action:function(){}}]});
            }
        });

    }
</script>
</html>